from apps.meiduo_admin.utils import PageNum
from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import ListAPIView
from apps.meiduo_admin.serializers.admin import AdminSerializer,GroupSerializer
from apps.users.models import User
from django.contrib.auth.models import Group


class AdminModelViewSet(ModelViewSet):
    queryset = User.objects.filter(is_staff=True)
    serializer_class = AdminSerializer
    pagination_class = PageNum


class GroupListAPIView(ListAPIView):
    queryset = Group.objects.all()
    serializer_class = GroupSerializer